﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fuse8.ContentManagementFramework.Domain.Commands.CommandParameters;
using Fuse8.DomainFramework.Domain;

namespace Fuse8.ContentManagementFramework.Domain.Commands
{
    public abstract class CmsEntitySearchCommand<TEntity> : BaseEntityParameterCommand<TEntity, CmsEntitySearchCommandParameter> where TEntity : Int32EntityObject, new()
    {
        public override string CacheKey
        {
            get
            {
                return string.Format("CmsEntitySearchCommand_{0}_{1}_{2}_{3}_{4}",
                    typeof(TEntity).Name, CommandParameter.SearchQuery,
                    CommandParameter.IsInAdministrationArea, 
                    CommandParameter.SiteGroupId,
                    CommandParameter.SiteId);
            }
        }

        public override string CommandName
        {
            get { return "CmsEntitySearchCommand"; }
        }
    }
}
